using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class hyhyhy:MonoBehaviour
{
    public float allTime = 3.0f;

    Action onTimeOverFunc;

    public void SetFunc(Action fun)
    { 
        onTimeOverFunc = fun;
    }

    private void Update()
    {
        if (allTime > 0)
        { 
            allTime-=Time.deltaTime;
            if (isDone())
            {
                onTimeOverFunc();
            }
        }
    }

    public bool isDone()
    {
        return allTime <= 0;
    }




}
